const testKind = {
  namespaced: true,
  state() {
    return {
      // 整体分类数据
      allKind: [],
      // 当前二级标题
      kind: "消防安全工程师",
      // 收集的准确主题标题
      putKind: [],
    };
  },
  getters: {
    currentThreeData: (state) => {
      let childrenThree = [];
      state.allKind.filter((item) => {
        if (item.id === state.putKind[0].id) {
          console.log(item.childrenTwo);
          item.childrenTwo.filter((item2) => {
            if (item2.id === state.putKind[1].id) {
              console.log(item2.childrenThree);
              childrenThree = item2.childrenThree;
              return;
            }
          });
        }
      });
      return childrenThree;
    },
  },
  mutations: {
    // 选择考试类别
    selectTestKind(state, value) {
      // state.kind = {
      //     text:value[1].text,
      //     id:value[1].id
      // };
      state.kind = value[1].text;
      state.putKind = value;
    },
    // 三级切换 修改putKind的三级分类数据
    setGradeThree(state, value) {
      state.putKind[2] = value;
    },
    // 整体分类数据
    getAllKind(state, value) {
      state.allKind = value;
    },
  },
};
export default testKind;
